//Day5 
//1.算法题：https://leetcode-cn.com/problems/implement-queue-using-stacks/

var MyQueue = function () {
    this.list = []
};

/** 
 * @param {number} x
 * @return {void}
 */
MyQueue.prototype.push = function (x) {
    this.list.push(x)
};

/**
 * @return {number}
 */
MyQueue.prototype.pop = function () {
    return this.list.shift()
};

/**
 * @return {number}
 */
MyQueue.prototype.peek = function () {
    return this.list[0]
};

/**
 * @return {boolean}
 */
MyQueue.prototype.empty = function () {
    return this.list.length === 0
};

/**
 * Your MyQueue object will be instantiated and called as such:
 * var obj = new MyQueue()
 * obj.push(x)
 * var param_2 = obj.pop()
 * var param_3 = obj.peek()
 * var param_4 = obj.empty()
 */

// 2.手写题：https://bigfrontend.dev/zh/problem/the-angle-between-hour-hand-and-minute-hand-of-a-clock

function angle(time) {
    // your code here
    const t = 0.5 //时针1分钟走0.5度
    const m = 6   //分针1分钟走6度
    let [tt, mm] = time.split(':')
    tt = Number(tt) //时针
    mm = Number(mm) //分针
    if (tt > 12) tt -= 12
    return Math.min((tt + mm / 60) * 60 * 0.5 - mm * 6, 360 - ang1)
}

console.log(angle('23:30'))
console.log(angle('12:00'))